<template>
  <div class="app-container">
    <MergeTable :empty-text="'该年度暂无年度计划, 请新增'" highlight-current-row
                :merge-arr="ckMergeArr"
                v-loading="loading" :table-data="ywjhList">
      <!--      <el-table-column type="selection" width="55" align="center"/>-->
      <!--      <el-table-column label="序号" align="center" type="index"/>-->
      <!--      <el-table-column show-overflow-tooltip label="仓库ID" align="center" prop="ckId"/>-->
      <el-table-column label="业务申报" align="center" prop="ywSb"/>
      <el-table-column label="年度" align="center" prop="nd" width="100"/>
      <el-table-column label="业务类型" align="center" prop="ywLx"/>
      <el-table-column label="计划类别" align="center" prop="jhLb"/>
      <el-table-column label="申报时限" align="center" prop="jhZt">
        <template slot-scope="scope">
          <span style="color: #13ce66" v-if="scope.row.jhZt == '进行中'">{{ scope.row.jhZt }}</span>
          <span style="color: #ff0000" v-else>{{ scope.row.jhZt }}</span>
        </template>
      </el-table-column>
      <el-table-column label="在线申报" align="center" class-name="small-padding fixed-width">
        <template slot-scope="scope">
          <el-button
            :style="{ width: '100%', backgroundColor: scope.row.jhZt == '进行中' ? '#13ce66' : '#ff0000' }"
            @click="handleClick(scope.row)"
          >
            <span style="color: #e1f3fb; font-weight: 600">进入申报</span>
          </el-button>
        </template>
      </el-table-column>
    </MergeTable>

  </div>
</template>

<script>
import {listYwjh} from "@/api/xtgl/ywjh";
import MergeTable from "@/components/MergeTable/index.vue";

export default {
  name: "ywdh",
  components: {MergeTable},
  //业务导航
  data() {
    return {
      // 遮罩层
      loading: true,
      ckMergeArr: ['ywSb'],
      // 业务计划表格数据
      ywjhList: [],
      // 查询参数
      queryParams: {
        pageNum: 1,
        pageSize: 50,
        ywSb: null,
        nd: new Date().getFullYear().toString(),
        ywLx: null,
        jhLb: null,
        ksRq: null,
        jsRq: null,
        px: null,
        idWhere: null,
        userId: null,
        deptId: null
      },
    }
  },
  created() {
    this.getList();
  },
  methods: {
    handleClick(row) {
      if (row.ywSb === '项目管理') {
        if (row.ywLx === '立项申报') {
          this.$router.push({path: "/xmgl/lxsb/xmsb"});
        } else if (row.ywLx === '合同编制') {
          this.$router.push({path: "/xmgl/htgl/htbz"});
        } else if (row.ywLx === '执行情况') {
          this.$router.push({path: "/xmgl/implement/zxtb"});
        } else if (row.ywLx === '中间检查') {
          this.$router.push({path: "/xmgl/zjjc/jctb"});
        } else if (row.ywLx === '成果鉴定') {
          this.$router.push({path: "/xmgl/jdys/jdsq"});
        } else if (row.ywLx === '公司科技进步奖') {

        } else if (row.ywLx === '预算申报') {
          this.$router.push({path: "/xmgl/budget/yssb"});
        }
      } else if (row.ywSb === '科技成果') {
        if (row.ywLx === '企业工法申报') {
          this.$router.push({path: "/kjcg/qygf/qygfsb"});
        } else if (row.ywLx === '专利申请') {
          this.$router.push({path: "/zscq/zlgl/zlsb"});
        } else if (row.ywLx === '商标申请') {
          this.$router.push({path: "/zscq/sbgl"});
        } else if (row.ywLx === '软件著作权') {
          this.$router.push({path: "/zscq/rzgl/rzsq"});
        }
      } else if (row.ywSb === '专家评审') {
        if (row.ywLx === '立项评审') {

        } else if (row.ywLx === '成果鉴定') {

        } else if (row.ywLx === '科技进步奖') {

        } else if (row.ywLx === '企业工法') {

        }
      } else if (row.ywSb === '政策享受') {
        if (row.ywLx === '加计扣除') {
          this.$router.push({path: "/jjkc/AdditionalDeduction/jjkcsq"});
        }
      } else if (row.ywSb === '平台资质') {
        if (row.ywLx === '高企认定') {

        }
      }
    },
    /** 查询业务计划列表 */
    getList() {
      this.loading = true;
      listYwjh(this.queryParams).then(response => {
        this.ywjhList = response.rows;
        this.loading = false;
      });
    },

  }
}
</script>

<style scoped>

</style>
